package fallingGame;

import javax.swing.JTable;

/**
 * <p>
 * Title: MyTable
 * </p>
 * <p>
 * Description: CS 343 Course Project MyTable is a custom JTable class that does
 * not allow the cells to be editable, the columns to be reordered, or the table
 * resized.
 * </p>
 * 
 * @author Nathanial Howard, Joe Costello, Dustin Schwingle, Jared Potter
 * @email nathanial.howard@my.uwrf.edu, anthony.costello@my.uwrf.edu,
 *        dustin.schwingle@my.uwrf.edu, jared.potter@my.uwrf.edu
 * @date December 01, 2011
 * @team Group 2
 */
public class MyTable extends JTable {

	private static final long serialVersionUID = 1L;

	/**
	 * MyTable
	 * 
	 * constructor that takes in the data and the column titles for the JTable
	 * and adds the data in the appropriate column
	 * 
	 * @param data
	 * @param headers
	 * @ensure data will be loaded into the table with the appropriate column
	 *         headers, the table can not be resized, and the columns can not be
	 *         reordered
	 */
	public MyTable(Object[][] data, Object[] headers) {
		super(data, headers);
		getTableHeader().setReorderingAllowed(false);
		getTableHeader().setResizingAllowed(false);
	}

	/**
	 * isCellEditable
	 * 
	 * called when the user clicks on a cell in the JTable
	 * 
	 * @return false
	 * @ensure no cell will be editable
	 */
	public boolean isCellEditable(int row, int column) {
		return false;
	}

}
